/**
	Pulsar engine. Additional include file.
	Windows template dialog boxes

	Copyright (C) 2013-2014 Dmitry Dolgov

	This program is free software; you can redistribute it and/or modify it under the terms of the
	GNU General Public License as published by the Free Software Foundation; either version 2 of
	the License, or (at your option) any later version.

	This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
	without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
	See the GNU General Public License for more details.
*/

#if !defined(PL_WINDOWS) && !defined(PL_WINDOWS64)
#error "Wrong operation system"
#endif

namespace pl
{

/**
	DLGTEMPLATE object construction
*/
class DlgTemplate
{
public:
	/// ctor
	DlgTemplate(DWORD windowStyle, const pl_char* title, const RECT& rect, DWORD windowExStyle = 0);

	/// dtor
	~DlgTemplate();

	/// Add new control
	void addControl(DWORD style, DWORD exStyle, const RECT& rect, int id, const pl_char* wndClass, const pl_char* title);

	/// Get dialog template
	LPCDLGTEMPLATE getGlobalMem();

private:
	void _add(const void* p, size_t size);
	void _add(const pl_char* str);
	void _align(size_t align);
	bool _expand(size_t size);

	pl_uint8* _pMemory;
	size_t _curSize;
	size_t _memSize;
	pl_uint16* _pNControls;
	HGLOBAL _hglb;
};

} // namespace pl

//
// End of file 'pulsar_dlgtemplate_win.h'
//
